<?php

class Zend_View_Helper_CurrentTag {
    public function currentTag($currentTags,$tag,$level){
        if(null!=$currentTags){
            if(isset($currentTags[$level])&&$currentTags[$level]==$tag){
                unset($currentTags[$level]);
            }else{
                $currentTags[$level]=$tag;
            }
            if(count($currentTags)>0){
                ksort($currentTags);
                foreach ($currentTags as $tag){
                    $data[]=$tag;
                }
                $strTag=implode("-", $data);
            }else{
                $strTag="";
            }
        }else{
            $strTag=$tag;
        }
        return urlencode($strTag);
    }
}

?>